package com.example.cxz2021606127.util;

import android.content.Context;
import android.widget.Toast;

/**
 * Toast工具类，用于连续点击多次但只会弹出一次提示
 */
public class ToastUtil {
    public static Toast toast;

    public static void showMsg(Context context, String msg) {
        if (toast == null) {
            toast = Toast.makeText(context, msg, Toast.LENGTH_SHORT);
        } else {
            toast.setText(msg);
        }
        toast.show();
    }

}
